﻿/*
 * Plugin tracer base class
 *
 *
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Snowdreamist.ComponentModel.Plugin;

namespace Snowdreamist.ComponentModel.Primitives
{
    internal abstract class ImportedPluginTracer
    {
        /// <summary>
        /// Get saved plugins
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="TMetadata"></typeparam>
        /// <param name="instance"></param>
        /// <param name="ownerType"></param>
        /// <param name="metadata"></param>
        /// <returns></returns>
        public abstract IEnumerable<ImportedPlugin<T, TMetadata>> GetPlugins<T, TMetadata>
            (
            object instance,
            Type ownerType,
            ContractMetadata metadata
            );

        /// <summary>
        /// Trace plugins
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <typeparam name="TMetadata"></typeparam>
        /// <param name="instance"></param>
        /// <param name="ownerType"></param>
        /// <param name="metadata"></param>
        /// <param name="importedPlugins"></param>
        public abstract void Trace<T, TMetadata>(
            object instance,
            Type ownerType,
            ContractMetadata metadata,
            IEnumerable<ImportedPlugin<T, TMetadata>> importedPlugins
            );
    }
}